<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<link rel="stylesheet" href="./css/common.css">
		<link rel="stylesheet" href="./css/public.css">
		<link rel="stylesheet" href="./css/tuku.css">
		<link rel="stylesheet" type="text/css" href="layui/css/layui.css" />
		<title>魔豆素材网</title>
	</head>
	<body>
		<!-- 头部 -->
		<header class="header">
			<div class="header-inner w-m clearfix">
				<div class="logo"><img src="img/logo.png" alt=""></div>
				<div class="shouquan"><img src="img/shouquan.png" alt=""></div>
				<ul class="nav clearfix">				
					<li><a href="modou.html">首页</a></li>
					<li><a href="tuku.html" class="active">原创图库</a></li>
					<li><a href="shouhui.html">手绘定制</a></li>
				</ul>
				<!-- 已登录 -->
				<div class="user clearfix" style="display: none;">
					<img src="img/tx.png" >
					<span>
						张灵灵<br/>
						<font>ID:235342</font>
					</span>
				</div>
				<!-- 未登录 -->
				<div class="reg">
					<a href="login-register.html">登录</a> / <a href="login-register.html">注册</a>
				</div>
			</div>			
		</header>
		
		<!-- 分类列表 -->
		<div class="headerlist w-m clearfix">
			<div class="sort">
				<img src="./img/isort.png" alt="" srcset="">
				<span>分类</span>
				<ul>
					<li class="lion">场景类</li>
					<li>女子类</li>
					<li>男子类</li>
					<li>男女类</li>
					<li>其他类</li>
				</ul>
			</div>
			<ul class="clearfix">
				<li class="on">玄幻</li>
				<li>仙侠</li>
				<li>都市</li>
				<li>异能</li>
				<li>军事</li>
				<li>历史</li>
				<li>二次元</li>
				<li>科幻</li>
				<li>动漫</li>
				<li>校园</li>
				<li>现言</li>
				<li>古言</li>
				<li>枕美</li>
				<li>灵异</li>
				<li>其他</li>
			</ul>
		</div>
		
		<!-- banner -->
		<div class="banner">
			<p>300000+原创图库等你下载</p>
			<div class="input">
				<input type="text" placeholder="输入关键词进行搜索">
				<p class="sbtn">
					<img src="./img/search.png" alt="" srcset="">
				</p>
			</div>
		</div>
		
		<!-- 三个特点 -->
		<div class="middle">
			<ul class="clearfix w-m">
				<li class="item">
					<img src="img/deng.png">
					<p>
						<span>原创手绘</span><br>
						<span>作品严格审核</span>
					</p>
				</li>
				<li class="item">
					<img src="img/biao.png">
					<p>
						<span>快速合作</span><br>
						<span>24小时出图</span>
					</p>
				</li>
				<li class="item">
					<img src="img/xinyu.png">
					<p>
						<span>信誉保证</span><br>
						<span>拒绝盗版，全额赔付</span>
					</p>
				</li>
			</ul>
		</div>


		<div class="wrap">
			<div class="w-m">
				<div class="list1">
					<div class="title">
						<img src="img/huangguan.png" alt="">
						<span>精品素材</span>
						<a href="" class="more">更多 <i class="layui-icon layui-icon-right"></i></a>
					</div>
					<div class="content clearfix">
						<ul class="clearfix">
							<li>
								<a href="">
									<div class="wImg">
										<img src="./img/niao.png" alt="" srcset="">
										<img src="./img/new.png" alt="" srcset="">
									</div>
									<div class="info">
										<span>鸟类</span>
										<span>收藏99+ 人</span>
										<span>总计65张</span>
									</div>
								</a>
							</li>
							<li>
								<a href="">
									<div class="wImg">
										<img src="./img/niao.png" alt="" srcset="">
										<img src="./img/new.png" alt="" srcset="">
									</div>
									<div class="info">
										<span>鸟类</span>
										<span>收藏99+ 人</span>
										<span>总计65张</span>
									</div>
								</a>
							</li>
							<li>
								<a href="">
									<div class="wImg">
										<img src="./img/niao.png" alt="" srcset="">
										<img src="./img/new.png" alt="" srcset="">
									</div>
									<div class="info">
										<span>鸟类</span>
										<span>收藏99+ 人</span>
										<span>总计65张</span>
									</div>
								</a>
							</li>
							<li>
								<a href="">
									<div class="wImg">
										<img src="./img/niao.png" alt="" srcset="">
										<img src="./img/new.png" alt="" srcset="">
									</div>
									<div class="info">
										<span>鸟类</span>
										<span>收藏99+ 人</span>
										<span>总计65张</span>
									</div>
								</a>
							</li>
							<li>
								<a href="">
									<div class="wImg">
										<img src="./img/niao.png" alt="" srcset="">
										<img src="./img/new.png" alt="" srcset="">
									</div>
									<div class="info">
										<span>鸟类</span>
										<span>收藏99+ 人</span>
										<span>总计65张</span>
									</div>
								</a>
							</li>
							<li>
								<a href="">
									<div class="wImg">
										<img src="./img/niao.png" alt="" srcset="">
										<img src="./img/new.png" alt="" srcset="">
									</div>
									<div class="info">
										<span>鸟类</span>
										<span>收藏99+ 人</span>
										<span>总计65张</span>
									</div>
								</a>
							</li>
							<li>
								<a href="">
									<div class="wImg">
										<img src="./img/niao.png" alt="" srcset="">
										<img src="./img/new.png" alt="" srcset="">
									</div>
									<div class="info">
										<span>鸟类</span>
										<span>收藏99+ 人</span>
										<span>总计65张</span>
									</div>
								</a>
							</li>
							<li>
								<a href="">
									<div class="wImg">
										<img src="./img/niao.png" alt="" srcset="">
										<img src="./img/new.png" alt="" srcset="">
									</div>
									<div class="info">
										<span>鸟类</span>
										<span>收藏99+ 人</span>
										<span>总计65张</span>
									</div>
								</a>
							</li>

						</ul>
					</div>

				</div>
				<div class="list2">
					<div class="title">
						<img src="img/deng1.png" alt="">
						<span>原创素材</span>
						<a href="" class="more">更多 <i class="layui-icon layui-icon-right"></i></a>
					</div>
					<div class="content" id="content">
						<div class="item">
							<a href="">
								<img src="./img/tu11.png" alt="">
								<div class="itemInfo">
									<span>恐怖系列</span>
									<i>200人收藏</i>
								</div>
							</a>
						</div>
						<div class="item">
							<a href="">
								<img src="./img/tu22.png" alt="">
								<div class="itemInfo">
									<span>恐怖系列</span>
									<i>200人收藏</i>
								</div>
							</a>
						</div>
						<div class="item">
							<a href="">
								<img src="./img/tu33.png" alt="">
								<div class="itemInfo">
									<span>恐怖系列</span>
									<i>200人收藏</i>
								</div>
							</a>
						</div>
						<div class="item">
							<a href="">
								<img src="./img/tu44.png" alt="">
								<div class="itemInfo">
									<span>恐怖系列</span>
									<i>200人收藏</i>
								</div>
							</a>
						</div>
						<div class="item">
							<a href="">
								<img src="./img/tu55.png" alt="">
								<div class="itemInfo">
									<span>恐怖系列</span>
									<i>200人收藏</i>
								</div>
							</a>
						</div>
						<div class="item">
							<a href="">
								<img src="./img/tu66.png" alt="">
								<div class="itemInfo">
									<span>恐怖系列</span>
									<i>200人收藏</i>
								</div>
							</a>
						</div>
						<div class="item">
							<a href="">
								<img src="./img/tu77.png" alt="">
								<div class="itemInfo">
									<span>恐怖系列</span>
									<i>200人收藏</i>
								</div>
							</a>
						</div>
						<div class="item">
							<a href="">
								<img src="./img/tu88.png" alt="">
								<div class="itemInfo">
									<span>恐怖系列</span>
									<i>200人收藏</i>
								</div>
							</a>
						</div>
						<div class="item">
							<a href="">
								<img src="./img/tu55.png" alt="">
								<div class="itemInfo">
									<span>恐怖系列</span>
									<i>200人收藏</i>
								</div>
							</a>
						</div>
						<div class="item">
							<a href="">
								<img src="./img/tu11.png" alt="">
								<div class="itemInfo">
									<span>恐怖系列</span>
									<i>200人收藏</i>
								</div>
							</a>
						</div>
						<div class="item">
							<a href="">
								<img src="./img/tu88.png" alt="">
								<div class="itemInfo">
									<span>恐怖系列</span>
									<i>200人收藏</i>
								</div>
							</a>
						</div>
						<div class="item">
							<a href="">
								<img src="./img/tu33.png" alt="">
								<div class="itemInfo">
									<span>恐怖系列</span>
									<i>200人收藏</i>
								</div>
							</a>
						</div>
						<div class="item">
							<a href="">
								<img src="./img/tu22.png" alt="">
								<div class="itemInfo">
									<span>恐怖系列</span>
									<i>200人收藏</i>
								</div>
							</a>
						</div>
						<div class="item">
							<a href="">
								<img src="./img/tu77.png" alt="">
								<div class="itemInfo">
									<span>恐怖系列</span>
									<i>200人收藏</i>
								</div>
							</a>
						</div>
						<div class="item">
							<a href="">
								<img src="./img/tu88.png" alt="">
								<div class="itemInfo">
									<span>恐怖系列</span>
									<i>200人收藏</i>
								</div>
							</a>
						</div>
						<div class="item">
							<a href="">
								<img src="./img/tu99.png" alt="">
								<div class="itemInfo">
									<span>恐怖系列</span>
									<i>200人收藏</i>
								</div>
							</a>
						</div>
						<div class="item">
							<a href="">
								<img src="./img/tu100.png" alt="">
								<div class="itemInfo">
									<span>恐怖系列</span>
									<i>200人收藏</i>
								</div>
							</a>
						</div>
						<div class="item">
							<a href="">
								<img src="./img/tu110.png" alt="">
								<div class="itemInfo">
									<span>恐怖系列</span>
									<i>200人收藏</i>
								</div>
							</a>
						</div>
						<div class="item">
							<a href="">
								<img src="./img/tu120.png" alt="">
								<div class="itemInfo">
									<span>恐怖系列</span>
									<i>200人收藏</i>
								</div>
							</a>
						</div>
						<div class="item">
							<a href="">
								<img src="./img/tu130.png" alt="">
								<div class="itemInfo">
									<span>恐怖系列</span>
									<i>200人收藏</i>
								</div>
							</a>
						</div>
						<div class="item">
							<a href="">
								<img src="./img/tu140.png" alt="">
								<div class="itemInfo">
									<span>恐怖系列</span>
									<i>200人收藏</i>
								</div>
							</a>
						</div>
					</div>
				</div>
				<!-- 分页 -->
				<div id="demo7" style="text-align: center;margin-top: 40px;"></div>
			</div>
		</div>

		<!-- 底部 -->
		<footer class="footer">
			<ul class="nav">
				<li><a href="">关于我们</a></li>
				<li><a href="">友情链接</a></li>
				<li><a href="">个人会员版</a></li>
				<li><a href="">隐私协议</a></li>
				<li><a href="">服务条款</a></li>
				<li><a href="">联系我们</a></li>
				<li><a href="">加入我们</a></li>
			</ul>
			<p class="flink">
				<a href="">联合推广 market@163.com</a>
				<a href="">友链交换 market@163.com</a>
			</p>
			<p class="ewm"><img src="img/ewm.png"></p>
			<a href="" class="beian">Copyright © 2017 MIUI 京ICP备10046444号 | 京公网安备11010802020134号 | 京ICP证110507号</a>
		</footer>

		<!-- 回到顶部 -->
		<div class="scollTop">
			<ul>
				<li class="scrollon">场景类</li>
				<li>女子类</li>
				<li>男子类</li>
				<li>男女类</li>
				<li>其他类</li>
				<li>
					<img src="./img/huojian.png" alt="" srcset="">
					TOP
				</li>
			</ul>
		</div>
		<script src="layui/layui.js" charset="utf-8"></script>
		<script charset="utf-8">
			// 回到顶部
			var oScrolltop = document.querySelector('.scollTop ul li:last-child');
			oScrolltop.onclick = function() {
				function smoothscroll() {
					var currentScroll = document.documentElement.scrollTop || document.body.scrollTop;
					if (currentScroll > 0) {
						window.requestAnimationFrame(smoothscroll);
						window.scrollTo(0, currentScroll - (currentScroll / 6));
					}
				}
				smoothscroll()
			}
			
			
			layui.use(['jquery', 'laypage','layer'], function() {
				var $ = layui.jquery;
				var layer= layui.layer;
				var laypage = layui.laypage;
				
				// 获取所搜词
				$(".sbtn").click(function(){
					var search=$(".input input").val();
					if(search.length>0){
						console.log(search)
						window.open("search.html")
					}else{
						layer.tips('请输入搜索词', '.input', {tips: [3, '#00cc90'],time:1500, anim: 6});
						return false;
					}
				})
				
				// 分页
				laypage.render({
					elem: 'demo7',
					count: 354,
					layout: ['prev', 'page', 'next', 'count', 'skip'],
					groups: 8,
					jump: function(obj) {
						console.log(obj)
					}
				});
				
				// 分类下拉
				$(".sort").hover(function () {
				    $(".sort ul").slideDown();
				},function () {
				    $(".sort ul").slideUp();
				});
				
				$(".sort li").hover(function () {
				    $(this).addClass("lion");
				},function () {
				    $(this).removeClass("lion");
				});
				
				// 返回顶部
				$(".scollTop ul li").not($(".scollTop ul li").last()).click(function() {
					$(".scollTop ul li").not($(".scollTop ul li").last()).eq($(this).index()).addClass("scrollon").siblings().removeClass("scrollon");
				})
				// 监听页面滚动
				 $(document).scroll(function() {
			        var scroH = $(document).scrollTop();  //滚动高度
					var viewH = $(window).height();  //可见高度 
					var contentH = $(document).height();  //内容高度
			
			        if(scroH >400){  //距离顶部大于100px时
						// console.log("xx",scroH)
						$(".scollTop").show();
			        }else{
						$(".scollTop").hide();
					}
	   			 })
			})
		</script>
		
		<!-- 瀑布流js 部分 -->
		<script>
			var box = document.getElementById('content');
			var items = box.children;
			// 定义每一列之间的间隙 为10像素
			var gap = 10;
			window.onload = function() {
				// 一进来就调用一次
				waterFall();
				// 封装成一个函数
				function waterFall() {
					// 1- 确定列数  = 页面的宽度 / 图片的宽度
					var pageWidth = document.querySelector("#content").offsetWidth;
					var itemWidth = items[0].offsetWidth;
					var columns = parseInt(pageWidth / (itemWidth + gap));
					var arr = [];
					for (var i = 0; i < items.length; i++) {
						if (i < columns) {
							// 2- 确定第一行
							items[i].style.top = 0;
							items[i].style.left = (itemWidth + gap) * i + 3 + 'px';
							arr.push(items[i].offsetHeight);
		
						} else {
							// 其他行
							// 3- 找到数组中最小高度  和 它的索引
							console.log(arr);
		
							var minHeight = arr[0];
							var index = 0;
							for (var j = 0; j < arr.length; j++) {
								if (minHeight > arr[j]) {
									minHeight = arr[j];
									index = j;
								}
							}
							// 4- 设置下一行的第一个盒子位置
							// top值就是最小列的高度 + gap
							items[i].style.top = arr[index] + gap + 'px';
							// left值就是最小列距离左边的距离
							items[i].style.left = items[index].offsetLeft + 'px';
		
							// 5- 修改最小列的高度
							// 最小列的高度 = 当前自己的高度 + 拼接过来的高度 + 间隙的高度
							arr[index] = arr[index] + items[i].offsetHeight + gap;
						}
					}
					var maxHeight = arr[0];
					for (var j = 0; j < arr.length; j++) {
							if (maxHeight < arr[j]) {
									maxHeight = arr[j];
							}
					}
					document.querySelector('#content').style.height = maxHeight + 'px';
				}
			};
			// clientWidth 处理兼容性
			function getClient() {
				return {
					width: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
					height: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
				}
			}
			// scrollTop兼容性处理
			function getScrollTop() {
				return window.pageYOffset || document.documentElement.scrollTop;
			}
			
		</script>
	</body>
</html>
